import 'package:bot_toast/bot_toast.dart';

// import 'package:exams_app/home_module/live_page.dart';
import 'package:exams_app/login_module/view.dart';
import 'package:exams_app/widget/hexcolor.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
// import 'package:camera/camera.dart';
import 'home_module/exams_module/device_page.dart';
import 'home_module/exams_module/view.dart';

import 'package:exams_app/home_module/live_module/live_pages.dart';
import 'package:rtmp_publisher/camera.dart';

List<CameraDescription> cameras;


void main()async {

  WidgetsFlutterBinding.ensureInitialized();
  cameras = await availableCameras();

  setCustomErrorPage();
  runApp(MyApp());




}




void setCustomErrorPage() {
  ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
    print(flutterErrorDetails.toString());
    return Container(
      // child: Text("请重新加载"),
      color: Colors.white,
    );
  };
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      builder: BotToastInit(),
      navigatorObservers: [BotToastNavigatorObserver()],
      debugShowCheckedModeBanner: false,
      title: '“档”建站台',
      theme: ThemeData(
        appBarTheme: AppBarTheme(
            centerTitle: true,
            // titleTextStyle: TextStyle(color: Colors.red),
            backgroundColor: HexColor('#2674FB'),
            elevation: 0),
        primaryColor: HexColor('#2674FB'), // 主题色
      ),
      home: LoginModulePage(),
    );
  }
}
